package com.beerandjesus.webapp.sportofkings.handicapper.struts.action;

import com.beerandjesus.sportofkings.handicapper.app.JockeyRatingDatabaseBuilder;
import com.beerandjesus.sportofkings.handicapper.dao.Database;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;

import java.io.File;

/**
 * Date: Jun 1, 2012
 * Time: 1:57:03 PM
 */
public abstract class DatabaseAction extends ActionSupport {

    private File fileUpload;
    private String fileUploadFileName;
    // TODO - add interface for rebuilding jockey database to jockey database builder
    private Database database;
    private JockeyRatingDatabaseBuilder builder;

    public File getFileUpload() {
        return fileUpload;
    }

    @RequiredFieldValidator(message="Please select a file")
    public void setFileUpload(File fileUpload) {
        this.fileUpload = fileUpload;
    }

    public String getFileUploadFileName() {
        return fileUploadFileName;
    }

    public void setFileUploadFileName(String fileUploadFileName) {
        this.fileUploadFileName = fileUploadFileName;
    }

    public JockeyRatingDatabaseBuilder getBuilder() {
        return builder;
    }

    public void setBuilder(JockeyRatingDatabaseBuilder builder) {
        this.builder = builder;
    }

    public Database getDatabase() {
        return database;
    }

    public void setDatabase(Database database) {
        this.database = database;
    }
}
